function Logger() {
	
};

Logger.LEVEL_NONE = 0;
Logger.LEVEL_DEBUG = 1;
Logger.LEVEL_INF0 = 2;
Logger.LEVEL_ERROR = 3;
Logger.LEVEL_ALL = 5;

Logger.currentLevel = Logger.LEVEL_INF0;

Logger.fmt = function(n) {
	if ((""+n).length >= 2) return n;
	return ("00"+n).substr(-2);
};

Logger.debug = function (message) {
	if (console != undefined && console != null && Logger.currentLevel >= Logger.LEVEL_INF0) {
		var f = Logger.fmt;
		var d = new Date();
		d = f(d.getDate()) + "/" + f(d.getMonth()+1) + "/" + f(d.getYear()) + " " + f(d.getHours()) + ":" + f(d.getMinutes()) + ":" + f(d.getSeconds()) ; 
		console.info("["+d+"] DEB: "+message);
	} 
};

Logger.info = function (message) {
	if (console != undefined && console != null && Logger.currentLevel >= Logger.LEVEL_INF0) {
		var f = Logger.fmt;
		var d = new Date();
		d = f(d.getDate()) + "/" + f(d.getMonth()+1) + "/" + f(d.getYear()) + " " + f(d.getHours()) + ":" + f(d.getMinutes()) + ":" + f(d.getSeconds()) ; 
		console.info("["+d+"] INF: "+message);
	} 
};

Logger.error = function (message) {
	if (console != undefined && console != null && Logger.currentLevel >= Logger.LEVEL_ERROR) {
		var f = Logger.fmt;
		var d = new Date();
		d = f(d.getDate()) + "/" + f(d.getMonth()+1) + f(d.getYear()) + " " + f(d.getHours()) + ":" + f(d.getMinutes()) + ":" + f(d.getSeconds()) ; 
		console.error("["+d+"] ERR: "+message);
	} 
};

